package com.javase.CS05;

public class Student {
    int sNo;
    String sName;
    char sSex;
    int sAge;
    int sJava;

    public Student(int sNo, String sName, char sSex, int sAge, int sJava) {
        this.sNo = sNo;
        this.sName = sName;
        this.sSex = sSex;
        this.sAge = sAge;
        this.sJava = sJava;
    }

    public static class test{
        public static void main(String[] args) {
            Student st1 = new Student(1001, "张三", '男', 18, 90);
            Student st2 = new Student(1002, "李四", '男', 18, 98);
            Student st3 = new Student(1003, "赵能", '男', 18, 92);
            Student st4 = new Student(1004, "王五", '男', 18, 91);
            Student st5 = new Student(1005, "赵四", '男', 18, 99);

            double scoreAvg = (double) (st1.sJava + st2.sJava + st3.sJava + st4.sJava + st5.sJava) / 5;

            int max = 0;
            int min = 999;

            int[] scores = {st1.sJava,st2.sJava,st3.sJava,st4.sJava,st5.sJava};
            for (int i = 0; i < scores.length; i++) {
                if (scores[i]>max){
                    max = scores[i];
                }

                if (scores[i]<min){
                    min = scores[i];
                }
            }
            System.out.println("平均成绩："+scoreAvg);
            System.out.println("最大成绩：" + max);
            System.out.println("最小成绩：" + min);
        }
    }

}
